package com.demo.voice2openapp.present;

import android.content.Context;

import com.demo.voice2openapp.activity.MainView;
import com.demo.voice2openapp.model.MainBiz;
import com.demo.voice2openapp.model.MainBizImpl;


public class MainPresentImpl implements MainPresent, MainPresent.OnVoiceDictationFinished {

    private Context context;
    private MainBiz mainBiz;
    private MainView mainView;

    public MainPresentImpl(MainView mainView, Context context) {
        this.context = context;
        this.mainView = mainView;
        mainBiz = new MainBizImpl(context, this);
    }

    @Override
    public void showToast(String str) {
        mainView.showToast(str);
    }

    @Override
    public void dicationFinished(String recorderEntity) {
        mainView.dicationFinished( recorderEntity);
    }

    @Override
    public void startVoiceDictation() {
        mainBiz.startVoiceDictation();
    }

    @Override
    public void stopVoiceDictation() {
        mainBiz.stopVoiceDictation();
    }

    @Override
    public void cancelVoiceDictation() {
        mainBiz.cancelVoiceDictation();
    }

    @Override
    public void onResume() {
        mainBiz.onResume();
    }

    @Override
    public void onPause() {
        mainBiz.onPause();
    }

    @Override
    public void onDestroy() {
        mainBiz.onDestroy();
    }


}
